import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'

export default defineConfig({
  plugins: [vue()],
  // 别名配置
  resolve: {
    alias: {
      "@": resolve(__dirname, 'src'),
      "@assets": resolve(__dirname, 'src/assets'),
    }
  },
  server: {
    host: '0.0.0.0',
    cors: true,
    // 跨域配置
    // proxy: {
    //   '/api': {
    //     target: 'http://82.156.209.61:8787/web/',  // 后台接口地址
    //     changeOrigin: true,
    //     rewrite: path => path.replace(/^\/api/, '')
    //   }
    // }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData:'@import "@/assets/styles/variables.scss";@import "@/assets/styles/common.scss";@import "@/assets/styles/theme.scss";'
      }
    }
  }
})
